#ifndef summa_h
#define summa_h
/* Header for the SUMMA algorithm */

typedef struct {
    int       p;         /* Total number of processes    */
    MPI_Comm  comm;      /* Communicator for all processes */
    MPI_Comm  row_comm;  /* Communicator for my row      */
    MPI_Comm  col_comm;  /* Communicator for my col      */
    int       q;         /* Order of grid                */
    int       my_rank;	 /* My rank in comm */
    int       my_rankR, my_rankC;   /* My rank in the row_comm and col_comm */
    int	      my_row, my_col;	    /* My row and column in the grid */
    MPI_Datatype  local_matrix_mpi_t;
} COMM_INFO_T;


typedef struct {
    int     n_bar;
#define Order(A) ((A)->n_bar)
    double  *entries;
#define Entry(A,i,j) (*(((A)->entries) + ((A)->n_bar)*(i) + (j)))
} LOCAL_MATRIX_T;
void  		 PrintMatrix(char* title, LOCAL_MATRIX_T* A);
void             cmdLine(int argc, char **argv, int& N,
		         int& niter, int& fcheck, int& nocomm);
#endif
